window.onload = function () {


    var lianjie1 = document.getElementById('lianjie1');
    var down = document.getElementById('down');
    var up = document.getElementById('up');

    up.onclick = function () {
        lianjie1.style.height = '30px';
        down.style.display = 'block';
        up.style.display = 'none';
    }
    down.onclick = function () {
        lianjie1.style.height = '98px';
        down.style.display = 'none';
        up.style.display = 'block';
    }





    var theright = document.getElementById('theright');
    var theup = document.getElementById('theup');
    var thedown = document.getElementById('thedown');
    var xintxt = document.getElementsByClassName('xintxt');
    // console.log(xintxt)
    theright.onmouseover = function () {
        theright.style.width = '60px';
        theup.style.width = '60px';
        thedown.style.width = '60px';
        for (i=0;i<xintxt.length;i++) {
        xintxt[i].style.display='block';
              
        }
    }
    theright.onmouseout = function () {
        theright.style.width = '40px';
        theup.style.width = '40px';
        thedown.style.width = '40px';
        for (i=0;i<xintxt.length;i++) {
            xintxt[i].style.display='none';
                  
            }

    }

      //city03
      var city03=document.getElementById('city03');
      var citymore=['全国','北京','上海','广州','深圳','杭州','天津','西安','苏州','武汉','厦门','长沙','成都','郑州','重庆']
      for(let i=0;i<citymore.length;i++) {
          var aA=document.createElement('a');
          city03.appendChild(aA);
          aA.innerHTML=citymore[i];       
      }
      
      var xihu=document.getElementById('xihu');
      var xihuqu=['西湖区','滨江区','余杭区','江干区','萧山区','拱墅区','下城区','上城区','富阳区','临安县','桐庐县','建德市','沈阳市','北京市']
      for (let i=0;i<xihuqu.length;i++) {
          var aA1=document.createElement('a');
          xihu.appendChild(aA1);
          aA1.innerHTML=xihuqu[i];
      }
      

      var job=document.getElementById('job');
      var job1=['工作经验','学历要求','薪资要求','融资阶段','公司规模'];
     
      for (let i=0;i<job1.length;i++) {
          var aDiv=document.createElement('div');
          job.appendChild(aDiv);
          var aI=document.createElement('i');
          aDiv.appendChild(aI);
          var aP=document.createElement('p');
          aDiv.appendChild(aP);
          aP.innerHTML=job1[i];
          var oDiv=document.createElement('div');
          oDiv.classList.add('jingyan1')

          aDiv.appendChild(oDiv)
          
      }
      
      var jingyan=['不限','在校生','应届生','1年以内','1-3年','3-5年','5-10年','十年以上'];
      var oDiv=job.getElementsByClassName('jingyan1');
    //   console.log(oDiv);
      for (let i=0;i<jingyan.length;i++) {
          var oA=document.createElement('a');
          oDiv[0].appendChild(oA);
          oA.innerHTML=jingyan[i];
      }
      var jingyan=['不限','3k以下','3-5k','5-10k','10-15k','15-20k','20-30k','30-50k','50k以上'];
      var oDiv=job.getElementsByClassName('jingyan1');
    //   console.log(oDiv);
      for (let i=0;i<jingyan.length;i++) {
          var oA=document.createElement('a');
          oDiv[1].appendChild(oA);
          oA.innerHTML=jingyan[i];
      }
      var jingyan=['不限','初中及以下','中专','高中','大专','本科','硕士','博士'];
      var oDiv=job.getElementsByClassName('jingyan1');
    //   console.log(oDiv);
      for (let i=0;i<jingyan.length;i++) {
          var oA=document.createElement('a');
          oDiv[2].appendChild(oA);
          oA.innerHTML=jingyan[i];
      }
      var jingyan=['不限','未融资','A轮','B轮','C轮','D轮及以上','已上市','不需要融资'];
      var oDiv=job.getElementsByClassName('jingyan1');
    //   console.log(oDiv);
      for (let i=0;i<jingyan.length;i++) {
          var oA=document.createElement('a');
          oDiv[3].appendChild(oA);
          oA.innerHTML=jingyan[i];
      }
      var jingyan=['不限','0-20人','20-90人','100-499人','500-999人','1000-9999人','10000人以上'];
      var oDiv=job.getElementsByClassName('jingyan1');
    //   console.log(oDiv);
      for (let i=0;i<jingyan.length;i++) {
          var oA=document.createElement('a');
          oDiv[4].appendChild(oA);
          oA.innerHTML=jingyan[i];
      }

       

    var quyu=document.getElementsByClassName('quyu')[0];
    var diqunum=document.getElementsByClassName('diqunum')[0];
    console.log(quyu)
    console.log(diqunum)

    quyu.onclick=function(){
        if(diqunum.style.display=='block'){
            diqunum.style.display='none'
        }else if(diqunum.style.display=='none'){
            diqunum.style.display='block'
        }
    }

    
    
      var oDiv=document.getElementById('div1');
      var oDiv2=document.getElementById('div2');
      var disX=0;
      var disY=0;
      oDiv.onmousedown=function(ev){
        var oEvent = ev||event;
        disX=oEvent.clientX-oDiv.offsetLeft;
        disY=oEvent.clientY-oDiv.offsetTop;
        console.log('按下：'+(disX+"-"+disY));
        
          document.onmousemove=function(ev){
               var oEvent = ev||event;
            // oDiv.style.background='yellow';
            var l=oEvent.clientX-disX;
            var t=oEvent.clientY-disY;
            
            var r=oDiv2.offsetWidth - oDiv.offsetWidth;
            var b=oDiv2.offsetWidth - oDiv.offsetWidth;

            if(l<0) l=0;
            if(l>r) l=r;
            if(t<0) t=0;
            if(t>b) t=b;

            oDiv.style.left=l+'px';
            console.log('移动：'+(oEvent.clientX-disX)+"-"+(oEvent.clientY-disY))
          };

          document.onmouseup=function(){
               document.onmousemove=null;
               document.onmouseup=null;
          };
          

          return false;
       };


            //获得canvas容器
            var canvas = document.getElementById('canvas'); 
            //获得画笔
            var ctx = canvas.getContext('2d'); 
            //canvas设置宽度
            canvas.width = canvas.parentNode.offsetWidth; 
            //canvas设置高度
            canvas.height = canvas.parentNode.offsetHeight;
            //如果浏览器支持requestAnimFrame则使用requestAnimFrame否则使用setTimeout 
            window.requestAnimFrame = (function(){ 
            return window.requestAnimationFrame  || 
              window.webkitRequestAnimationFrame || 
              window.mozRequestAnimationFrame || 
              function( callback ){ 
                   window.setTimeout(callback, 1000 / 60); 
              }; 
            })(); 
            // 波浪大小
            var boHeight = canvas.height / 2;
            var posHeight = canvas.height / 1.2;
            //初始角度为0 
            var step = 0; 
            //定义三条不同波浪的颜色 
            var lines = ["rgba(220,222,255, 0.4)", "rgba(259,149,249, 0.4)", "rgba(0,188,255, 0.4)"]; 
            function loop(){ 
                //清除canvas内容
                 ctx.clearRect(0,0,canvas.width,canvas.height); 
                 step++; 
                 //画3个不同颜色的矩形 
                 for(var j = lines.length - 1; j >= 0; j--) { 
                  ctx.fillStyle = lines[j]; 
                  //每个矩形的角度都不同，每个之间相差45度 
                  var angle = (step+j*50)*Math.PI/180; 
                  var deltaHeight = Math.sin(angle) * boHeight;
                  var deltaHeightRight = Math.cos(angle) * boHeight; 
                  ctx.beginPath();
                  ctx.moveTo(0, posHeight+deltaHeight); 
                  ctx.bezierCurveTo(canvas.width/2, posHeight+deltaHeight-boHeight, canvas.width / 2, posHeight+deltaHeightRight-boHeight, canvas.width, posHeight+deltaHeightRight); 
                  ctx.lineTo(canvas.width, canvas.height); 
                  ctx.lineTo(0, canvas.height); 
                  ctx.lineTo(0, posHeight+deltaHeight); 
                  ctx.closePath(); 
                  ctx.fill(); 
             }
             requestAnimFrame(loop);
            } 
            loop(); 

    
    var tittle =[
      {
        a:'数据挖掘高级研发工程师',
        p:'30-40k',
        span:'OPPO'
      },
      {
        a:'QQ音乐社交安卓研发',
        p:'25-50k 13薪',
        span:'腾讯'
      }
    ]
    var looked=document.getElementsByClassName('looked')[0];
  
    for (let i=0;i<tittle.length;i++) {
      // var sDiv = looked.createElement('div');
      var aDiv=document.createElement('div');
      aDiv.classList.add('qq')
      looked.appendChild(aDiv);

      var aA=document.createElement('a');
      aA.innerHTML=tittle[i].a;
      aDiv.appendChild(aA);
      
      
      var aP=document.createElement('p');
      aP.innerHTML=tittle[i].p;
      aDiv.appendChild(aP)

      var aSpan=document.createElement('span');
      aSpan.innerHTML=tittle[i].span;
      aDiv.appendChild(aSpan)

    }

    

    var one =[
      {
        a:'web前端',
        span:'20-40k',
        em1:'杭州',
        em2:' 3-5年',
        em3:'硕士',
        a1:'阿里巴巴集团',
        em3:'互联网',
        em4:'不需要融资',
        em5:'10000人以上',
        img:'./img/user10.jpg',
        em6:'张先生',
        em7:'高级前端开发工程师'
        
      }
    ]
   

    var jobleft1jobs=document.getElementById('jobleft1jobs');
    console.log(jobleft1jobs)
    for (let i=0;i<27;i++) {
      var aLi=document.createElement('li');
      jobleft1jobs.appendChild(aLi);
      aLi.classList.add('sss');

      var onediv=document.createElement('div');
      aLi.appendChild(onediv);
      var aA=document.createElement('a');
      aA.innerHTML=one[0].a;
      onediv.appendChild(aA);
      var aSpan=document.createElement('span');
      aSpan.innerHTML=one[0].span;
      onediv.appendChild(aSpan);
      var aP=document.createElement('p');
      onediv.appendChild(aP);
      var eM1=document.createElement('em');
      aP.appendChild(eM1);
      eM1.innerHTML=one[0].em1;
      var iI=document.createElement('i');
      aP.appendChild(iI);
      iI.classList.add('vline1');
      var eM1=document.createElement('em');
      aP.appendChild(eM1);
      eM1.innerHTML=one[0].em2;
      var iI=document.createElement('i');
      aP.appendChild(iI);
      iI.classList.add('vline1');
      var eM1=document.createElement('em');
      aP.appendChild(eM1);
      eM1.innerHTML=one[0].em3;
      
      
      
      var twodiv=document.createElement('div');
      aLi.appendChild(twodiv);
      var aA=document.createElement('a');
      aA.innerHTML=one[0].a1;
      twodiv.appendChild(aA);
      var aP=document.createElement('p');
      twodiv.appendChild(aP);
      var eM1=document.createElement('em');
      aP.appendChild(eM1);
      eM1.innerHTML=one[0].em3;
      var iI=document.createElement('i');
      aP.appendChild(iI);
      iI.classList.add('vline1');
      var eM1=document.createElement('em');
      aP.appendChild(eM1);
      eM1.innerHTML=one[0].em4;
      var iI=document.createElement('i');
      aP.appendChild(iI);
      iI.classList.add('vline1');
      var eM1=document.createElement('em');
      aP.appendChild(eM1);
      eM1.innerHTML=one[0].em5;
   

      var threediv=document.createElement('div');
      aLi.appendChild(threediv);
      threediv.classList.add('jober')
      var Img=document.createElement('img');
      threediv.appendChild(Img);
      Img.src=one[0].img;
      


      var aP=document.createElement('p');
      threediv.appendChild(aP);
      var eM1=document.createElement('em');
      aP.appendChild(eM1);
      eM1.innerHTML=one[0].em6;
      var iI=document.createElement('i');
      aP.appendChild(iI);
      iI.classList.add('vline1');
      var eM1=document.createElement('em');
      aP.appendChild(eM1);
      eM1.innerHTML=one[0].em7;
      

      
      var sS=document.createElement('s');
      aLi.appendChild(sS);
      sS.classList.add('ssgoutong');
      sS.innerHTML=('立即沟通')

    }
   

    







}